<!DOCTYPE html >
<html>
<head>
<meta name="Generator" content="TPshop v1.1" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>推荐商品</title>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<link rel="stylesheet" href="__ROOT__ /AI_radar/css/footer.css">
<link rel="stylesheet" href="__ROOT__ /AI_radar/css/font_my/iconfont.css">
<script type="text/javascript" src="__ROOT__ /AI_radar/js/token.js"></script>
<style type="text/css">
	body,html{
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
		overflow-x: hidden;
		color:#555555;
		background: #eee;
	}
	p{
		margin: 0;
		padding:0;
	}
	.shopping{
		width: 100%;
	}
	.shangping{
		background: #fff;
		display: none;
	}
	.head{
		width: calc(100% - 20px);
		padding: 0 10px;
		line-height: 35px;
		font-size: 18px;
		display: flex;
	}
	.headL{
		width: calc(100% - 60px);
		font-weight: bold;
	}
	.headR{
		width:60px;
		text-align: right; 
		color: #4f81d4;
		font-size: 16px;
	}
	.kong{
		height: 100px;
		line-height: 70px;
		text-align: center;
	}
	.add{
		color: #4f81d4;
	}
	.shoppingMy{
		width: calc(100% - 20px);
		padding: 0 10px;
	}
	.shopRz{
		width: 43%;
		height: 10rem;
		display: inline-block;
		margin:10px 3%;
		background: #fff;
		border-radius: 3px;
	}
	.shopRz img{
		width: 100%;
		height: 6rem;
		border-radius:3px 3px 0 0;
	}

	.moneyP{
		color: red;
		font-size: 14px;
		line-height: 2rem;
		text-indent: 3px;
	}
	.nameP{
		width: 100%;
		font-size: 13px;
		line-height: 2rem;
		overflow: hidden;
		text-overflow:ellipsis;
		white-space: nowrap;
		text-indent: 3px;
	}



	



</style>

</head>
<body>
	{include file="public/wx_share" /}
	<div class="shopping">
		<div class="head">
			<div class="headL">我的推荐商品</div>
			<div class="headR shoppingclicks">修改</div>

			
		</div>
		<div class="shangping">
			<div class="kong">暂无商品，请去<span class="add shoppingClick">添加</span></div>
		</div>
		<div class="shoppingMy">
	
			
		</div>

	</div>

<script src="__ROOT__ /AI_radar/js/jquery.js"></script>
<script type="text/javascript">
	$(".shoppingclicks").attr("onclick","window.location.href='" + window.urls.url + "/my/shopping?corpid=" + localStorage.getItem("CRM_corpId") + "'")
	$(".shoppingclick").attr("onclick","window.location.href='" + window.urls.url + "/my/shopping?corpid=" + localStorage.getItem("CRM_corpId") + "'")


	$.ajax({
	    url:window.urls.url +"/my/user/goods",
	    type:"POST",
	    contentType: "application/json",
		dataType:"json",
	    data:JSON.stringify({
	    	token:window.tokens.token_boss,
	    }),
	    success:function(res){
	    	// console.log(res)
	    	console.log(res.data)
	    	if(res.data.length>0){
		    	$.each(res.data, function(index, el) { 
		    		if(el.goods.length>0){
				   		$(".shangping").css("display","none")
				   		var div = $("<div class='shopRz'><img src='"+el.goods[0].main_img_url+"' alt=''><div class='nameP'>"+el.goods[0].name+"</div><p class='moneyP'>￥"+el.goods[0].price+"</p></div>")
				   		$(div).appendTo(".shoppingMy")
		    		}
	    		})
	    		
	    	}else{
	    		$(".shangping").css("display","block")
	    	}
	    },
	    error:function(res){
	      console.log(res)
	    }
	});



	// console.log($)

</script>
</body>
</html>